package com.woniuxy.food.app.apiImpl;

import cn.hutool.core.bean.BeanUtil;
import com.woniuxy.cloud.mall95.log.Log;
import com.woniuxy.food.client.foodtypespuclient.FoodTypeSpuManageClient;
import com.woniuxy.food.client.param.InsertFoodTypeSpuParam;
import com.woniuxy.food.service.FoodTypeSpuService;
import com.woniuxy.food.service.serviceparam.InsertFoodTypeSpuServiceParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;
import result.Result;

@RestController
public class FoodTypeSpuManageClientApiImpl implements FoodTypeSpuManageClient {
    @Autowired
    private FoodTypeSpuService foodTypeSpuService;
    @Override
    @Log("添加菜品类型关联菜品spu")
    public Result insertFoodTypeSpu(InsertFoodTypeSpuParam param) {
        InsertFoodTypeSpuServiceParam insertFoodTypeSpuServiceParam = BeanUtil.toBean(param, InsertFoodTypeSpuServiceParam.class);
        foodTypeSpuService.insertFoodTypeSpu(insertFoodTypeSpuServiceParam);
        return Result.success();
    }
}
